package com.ml.config;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ml.constant.BaseResult;

/**
 * 
 * @author Virgil
 * @Date 2020年8月24日
 * @Describe
 *    <p>
 *		统一异常处理
 *     </p>
 */
@ControllerAdvice
public class ExceptionHandle {

	@SuppressWarnings("rawtypes")
	@ExceptionHandler(value = Exception.class)
	@ResponseBody
	public BaseResult<?> handle(Exception e) {
		e.printStackTrace();
		return new BaseResult(e);
	}
}
